/**
 * Created by Administrator on 2016/10/16.
 */
angular.module('charityProject.service', []).service('$charityProjectService', ['$http', function ($http) {
    /**
     * 查询项目列表
     * @param params
     * @param success
     * @param fail
     */
    this.getProjectList = function (params, success, fail) {
        $http({
            method: 'GET',
            url: '/projects/list',
            params: params
        }).then(success, fail);
    };
    /**
     * 分页项目内容
     * @param params
     * @param success
     * @param fail
     */
    this.getProject = function (params, success, fail) {
        $http({
            method: 'GET',
            url: '/projects/content/',
            params: params
        }).then(success, fail);
    };
    /**
     * 分页项目内容
     * @param params
     * @param success
     * @param fail
     */
    this.addProject = function (params, success, fail) {
        $http({
            method: 'PUT',
            url: '/projects/addProject/',
            params: params
        }).then(success, fail);
    };
    /**
     * 分页项目内容
     * @param params
     * @param success
     * @param fail
     */
    this.updateProject = function (params, success, fail) {
        $http({
            method: 'PUT',
            url: '/projects/content/' + params.projectId,
            params: params
        }).then(success, fail);
    };
}]);